import requests
from api.auth.b_client.base import BClientApi
from common.encryDecry import Ms4AesEncrypt
from common.fileLoad import load_yaml_file


class LoginApi(BClientApi):
    def __init__(self):
        super().__init__()
        self.url = f"{self.host}/b/doLogin"
        self.method = "post"
        self.commom = load_yaml_file(r'/config/common.yml')
        print(">>>>>>>>>>",self.commom["webTestUser"][0],self.commom["webTestUserPwd"][0])
        self.json = {"account":self.commom["webTestUser"][0],"password":Ms4AesEncrypt().encrypt(self.commom["webTestUserPwd"][0])}
        self.resp = None

    # def send(self):
    #     # 创建session对象
    #     # session = requests.session()
    #     # self.resp = session.request(url=self.url,method=self.method,json=self.params)
    #     request = Request()
    #     resp = request(method=self.method, url=self.url, json=self.json)
    #
    #     return self.resp

